package com.unlcn.ils.kas.dao.model.onway.bo;

import java.io.Serializable;
import java.util.List;

public class GeelyOnWayBo implements Serializable {

  private static final long serialVersionUID = -2642847628496035370L;

  private String transportSn;
  private String vin;
  private String gpsSn;
  private String transportNum;
  private int transportMethord;
  private String date;
  private List<Position> positions;

  public class Position {
    String longitude;
    String latitude;
    String province;
    String city;
    String address;
    String dateTime;

    public String getLongitude() {
      return longitude;
    }

    public void setLongitude(String longitude) {
      this.longitude = longitude;
    }

    public String getLatitude() {
      return latitude;
    }

    public void setLatitude(String latitude) {
      this.latitude = latitude;
    }

    public String getProvince() {
      return province;
    }

    public void setProvince(String province) {
      this.province = province;
    }

    public String getCity() {
      return city;
    }

    public void setCity(String city) {
      this.city = city;
    }

    public String getAddress() {
      return address;
    }

    public void setAddress(String address) {
      this.address = address;
    }

    public String getDateTime() {
      return dateTime;
    }

    public void setDateTime(String dateTime) {
      this.dateTime = dateTime;
    }

    @Override
    public String toString() {
      return "position [address=" + address + ", city=" + city + ", dateTime=" + dateTime + ", latitude=" + latitude
          + ", longitude=" + longitude + ", province=" + province + "]";
    }

  }

  private enum enmTransportMethord {
    Road(116, "汽运"), Rail(118, "铁运"), Ship(117, "水运");

    Integer methordNum;
    String methordName;

    private enmTransportMethord(Integer methordNum, String methordName) {
      this.methordNum = methordNum;
      this.methordName = methordName;
    }

    public Integer getMethordNum() {
      return methordNum;
    }

    public String getMethordName() {
      return methordName;
    }

  }

  public String getTransportSn() {
    return transportSn;
  }

  public void setTransportSn(String transportSn) {
    this.transportSn = transportSn;
  }

  public String getVin() {
    return vin;
  }

  public void setVin(String vin) {
    this.vin = vin;
  }

  public String getGpsSn() {
    return gpsSn;
  }

  public void setGpsSn(String gpsSn) {
    this.gpsSn = gpsSn;
  }

  public String getTransportNum() {
    return transportNum;
  }

  public void setTransportNum(String transportNum) {
    this.transportNum = transportNum;
  }

  public int getTransportMethord() {
    return transportMethord;
  }

  public void setTransportMethord(int transportMethord) {
    this.transportMethord = transportMethord;
  }

  public String getDate() {
    return date;
  }

  public void setDate(String date) {
    this.date = date;
  }

  public List<Position> getPositions() {
    return positions;
  }

  public void setPositions(List<Position> positions) {
    this.positions = positions;
  }

  @Override
  public String toString() {
    return "GeelyOnwayBo [date=" + date + ", gpsSn=" + gpsSn + ", positions=" + positions + ", transportMethord="
        + transportMethord + ", transportNum=" + transportNum + ", transportSn=" + transportSn + ", vin=" + vin + "]";
  }

  public static Integer translateTransportMethord(String othersName) {
    if (othersName.lastIndexOf("铁") > 0) {
      return enmTransportMethord.Rail.getMethordNum();
    }
    if (othersName.lastIndexOf("水") > 0) {
      return enmTransportMethord.Ship.getMethordNum();
    }
    return enmTransportMethord.Road.getMethordNum();
  }
}